package com.xbongbong.sys.domain.dao;

import com.xbongbong.sys.domain.entity.ConditionEntity;
import com.xbongbong.sys.domain.entity.PriceSetEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface PriceSetDao {
    Integer insert(PriceSetEntity entity);

    void insertBatch(List<PriceSetEntity> list);

    PriceSetEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer update(PriceSetEntity entity);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    List<PriceSetEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    List<PriceSetEntity> getAllPrices(@Param("corpid") String corpid);

    void updateBatch(@Param("list") List<PriceSetEntity> list, @Param("corpid") String corpid);

    Integer getMaxPriority(@Param("corpid") String corpid);

    void updateBatchPriority(@Param("corpid") String corpid, @Param("priority") Integer priority);

    List<PriceSetEntity> getPricesByConditions(@Param("param") Map<String, Object> param, @Param("conditions") List<ConditionEntity> priceConditions);

    PriceSetEntity getByName(@Param("name") String name, @Param("corpid") String corpid);

    void closePriceManage(@Param("corpid") String corpid);
}